<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<meta charset="utf-8">
<head th:include="includes/add-include :: add-header"></head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal" id="myForm" th:object="${info}">
        <input type="hidden" id="userId" name="userId" th:field="*{userId}">
        <div class="form-group">
            <label class="col-sm-3 control-label">用户名：</label>
            <div class="col-sm-5">
                <input id="userName" name="userName" class="form-control" type="text" th:field="*{userName}">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">角色</label>
            <div class="col-sm-5">
                <select id="roles" name="roles"
                        class="selectpicker show-tick form-control"
                        multiple data-live-search="true" data-live-search-placeholder="Search"
                        data-actions-box="true" data-done-button="true">
                    <option th:each="obj : ${roleList}" th:value="${obj.roleId}" th:text="${obj.roleName}"></option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">性别</label>
            <div class="col-sm-5">
                <select id="sex" name="sex" class="form-control" th:with="types=${@dict.getData('sex_type')}">
                    <option th:each="data : ${types}" th:value="${data.dictCode}" th:text="${data.dictValue}" th:field="*{sex}"></option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">出生日期</label>
            <div class="col-sm-8">
                <!--指定 date标记-->
                <div class='input-group col-sm-5 select-date'>
                    <input type='text' id="dateChoice" name="birthday"
                           class="form-control" readonly="true" th:value="${#dates.format(info.birthday,'yyyy-MM-dd')}" />
                    <span class="input-group-addon">
                            <span class="glyphicon glyphicon-calendar"></span>
                        </span>
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">电话号码</label>
            <div class="col-sm-5">
                <input type="text" id="phone" name="phone" placeholder="电话号码"
                       class="form-control" th:field="*{phone}">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">Email</label>
            <div class="col-sm-5">
                <input type="text" id="email" name="email" placeholder="Email"
                       class="form-control" th:field="*{email}">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">地址</label>
            <div class="col-sm-5">
                <textarea class="form-control" name="address" rows="3">[[*{address}]]</textarea>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">备注</label>
            <div class="col-sm-5">
                <textarea class="form-control" id="remark" name="remark"
                                  rows="3">[[*{remark}]]</textarea>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-5 control-label"></label>
            <div class="col-sm-3">
                <a class="btn btn-info btn-rounded btn-lg-rd" onclick="edit()"><i class="fa fa-bell-o"></i>&nbsp;保存</a>
            </div>
        </div>
    </form>
    </div>
    <div th:include="includes/add-include :: add-footer"></div>
    <script th:src="@{/script/system/user/edit.js}"></script>
    <script th:inline="javascript">
	    var prefix = ctx + "system/user";
	    var roleData = [[${info.roles}]];
    </script>
</body>
</html>
